import os
import traceback

from loguru import logger

env = os.getenv('NEXUSAI2025_PIKA__ENV')

try:
  if env == 'dzy_dev' or env is None:
    from .dzy_dev import dzy_devConfig as Config
    logger.info('dzy_dev config loaded.')

  else:  # 默认使用本地开发环境的配置，省去设置环境变量的环节
    from .default import Config as Config
    logger.info('default config loaded.')

except Exception as e:
  logger.warning('Loading config for %s environment failed, use default config instead.', env or 'unspecified')
  logger.error(traceback.format_exc())
